import React from 'react'
import GiftItem from "../../GiftItem/GiftItem";

const GiftList = props => {

    const {
        showData,
        onGiftSelected,
    } = props


    const gifts = (
        <div
            className='flex flex-wrap-container'
            style={{
                padding: '8px 12px',
                overflow: 'hidden',
                maxHeight: '210px',
                overflowY: 'scroll',
            }}
        >
            {
                showData.map((gift, index) => {
                    const item = (
                        <GiftItem
                            gift={gift}
                            key={index}
                            onClick={() => onGiftSelected(gift)}
                        />
                    )
                    return item
                })
            }
        </div>
    )

    return gifts
}

export default GiftList
